Learning Objectives

After completing this lesson, you’ll be able to:

An Introduction to Email in Automations

It’s important to cover email notifications in some detail because they are one of the most commonly used protocol types on FME Flow.

“Email” is a protocol that may be used by both Trigger and Action components in an Automations workflow. Email Triggers receive incoming emails from external clients, and Email Actions send emails out to an external account.

Email Protocols

Email is not a single protocol and there are several methods of email transfer. FME Flow supports two of these email-related protocols: SMTP and IMAP.

SMTP (Simple Mail Transfer Protocol) is the ability to directly receive an email through an email server built into FME Flow, or indirectly send an email through an SMTP service, for example, a Gmail account.

IMAP (Internet Message Access Protocol) is an indirect process that connects to an email account on a server elsewhere. When that account receives an email, the IMAP protocol passes it on to FME Flow.

SMTP Trigger

SMTP Triggers are used when data is sent to FME Flow via a direct email. FME Flow receives an email and triggers an Action in response.

Such triggers are possible because FME Flow includes a built-in email server as one of its components. However, this does require that the hostname and domain of your FME Flow should resolve to a publicly accessible IP or DNS.

Note

The steps to set up the built-in email server for notifications are documented in the FME Flow Reference Manual.

However, FME Flow Hosted instances are automatically configured for email notifications and have a public domain name, so you don’t need to do any additional setup.

Creating an SMTP Trigger

Creating an SMTP Trigger is done in the Automations > Create Automation section of the FME Flow web interface, by choosing the Email - SMTP (received) protocol as a new Trigger.

Configuring Email - SMTP Details

Once the protocol type is selected, only the Email User Name parameter must be configured. This does not need to be an existing user or email; in the above example, it is set up to be AuthoringCourse. Note that you do not need to specify @FMEFlowHostname.com in the Email User Name parameter.

To construct the full email address, combine the Email Username with your FME Flow hostname. Now, for this example, whenever an email is sent to AuthoringCourse@YourFMEFlowHostname this Automation will receive an incoming message that contains the entire contents of that email, including the from and to address, and any attachments. This information is all processed by FME Flow so it can be used to trigger an Action downstream in the workspace.

In the SMTP trigger, there is an Optional Parameter to specify the location to download any email attachments. If this is not defined, the attachments will still be saved to a temporary location on FME Flow.

IMAP Triggers

IMAP (Internet Message Access Protocol) is a variation on email for incoming notifications.

Instead of using the built-in email server, an IMAP Trigger connects to another email server and monitors it for incoming email. When a new email arrives in that account, the Automation is triggered.

Creating an IMAP Trigger

Like the SMTP protocol, IMAP Triggers are set up in the Automations > Create Automation section of the web interface by creating a new or adding to an existing Automation, but this time choosing the Email -IMAP (received) protocol:

Configuring Email - IMAP Details

This Trigger has significantly more parameters, most are for defining the IMAP (Email) server connection.

There are two important parameters that let you decide what and when to watch this Email Server. Poll Interval determines how often FME Flow should check for emails. Emails to Fetch decides whether to fetch all unread emails or new emails only.

Like the SMTP Protocol, there is a parameter to select an FME Flow resource location in which to store any email attachments.

 
Note

Most email servers support IMAP functionality, as do the majority of cloud-based email providers such as Gmail, Outlook.com, Yahoo!, etc.; so it’s very easy to have FME Flow scan a Gmail account (for example) for incoming mail, and then act on its contents. FME Flow has the option to load templates for these popular email providers.